﻿using System;
using System.Configuration;
using Rodunu.Movies.Services.NetFlix.Properties;

namespace Rodunu.Movies.Services.NetFlix.DataProvider.NFService.Configuration
{
    public class NetflixServiceConfigurationSection : ConfigurationSection
    {
        public string APIKey
        {
            get { return Resources.ConsumerKey; }
        }

        public string Secret
        {
            get { return Resources.SharedSecret; }
        }

        public string ApplicationName
        {
            get { return Resources.ApplicationName; }
        }

        public string SignatureMethod
        {
            get { return Resources.NetFlixAPISignatureMethod; }
        }

        public string TokenStoreType
        {
            get { return Resources.TokenStoreType; }
        }

        public ITokenStore GetTokenStore()
        {
            try
            {
                return new FileTokenStore();
            }
            catch
            {
                return null;
            }
        }
    }
}